﻿using B.S.InOut.Domain;
using B.S.InOutErrorCode;
using MediatR;

namespace B.S.InOut.Read.Api.Application.Command
{
    // 插入移库记录的命令类
    public class InsertTranManagementCommand : IRequest<int>
    {
        public Tranmanagement Product { get; set; }

        public InsertTranManagementCommand(Tranmanagement product)
        {
            Product = product;
       }
    }

    // 根据 ID 获取移库记录的查询类
    public class GetTranManagementByIdQuery : IRequest<Tranmanagement>
    {
        public int Id { get; set; }

        public GetTranManagementByIdQuery(int id)
        {
            Id = id;
        }
    }

    /// <summary>
    /// 查询所有数据
    /// </summary>
    public class GetTranManagementAllQuery : IRequest<IEnumerable<Tranmanagement>>
    {
      

        public string? TransferNum { get; set; }
        public int? Transfer { get; set; }
        /// <summary>
        /// 审核状态
        /// </summary>
        public int? TranAuditstatus { get; set; }
        public int pageindex { get; set; }
        public int pagesize {  get; set; }
        public GetTranManagementAllQuery(string? transferNum, int? transfer, int? tranAuditstatus, int pageindex, int pagesize)
        {
            TransferNum = transferNum;
            Transfer = transfer;
            TranAuditstatus = tranAuditstatus;
            this.pageindex = pageindex;
            this.pagesize = pagesize;
        }

    }

    // 根据 ID 删除出库信息命令类，实现 IRequest 接口，请求返回受影响的行数
    public class DeleteTranmanageCommand : IRequest<int>
    {
        // 产品的 ID
        public int Id { get; set; }

        // 构造函数，接收出库信息 ID
        public DeleteTranmanageCommand(int id)
        {
            Id = id;
        }
    }
    /// <summary>
    /// 批量删除产品命令
    /// </summary>
    public class DeleteTranmanageCommandALL : IRequest<int>
    {
        /// <summary>
        /// 要删除的产品 ID 列表
        /// </summary>
        public IEnumerable<int> ProductIds { get; set; }

        /// <summary>
        /// 构造函数，初始化要删除的产品 ID 列表
        /// </summary>
        /// <param name="productIds">要删除的产品 ID 列表</param>
        public DeleteTranmanageCommandALL(IEnumerable<int> productIds)
        {
            ProductIds = productIds;
        }
    }

    // 更新产品命令类，实现 IRequest 接口，请求返回受影响的行数
    public class UpdateTranmanageCommand : IRequest<int>
    {
        // 要更新的产品对象
        public Tranmanagement Product { get; set; }

        // 构造函数，接收产品对象
        public UpdateTranmanageCommand(Tranmanagement product)
        {
            Product = product;
        }
    }
}
